MAX_PATH = 260;

def queryDosDevice(sDeviceName):
  sDeviceName = str(sDeviceName[:2]); # remove any trailing "\" and convert to ascii
  import ctypes;
  sNtDeviceName = ctypes.create_string_buffer(MAX_PATH)
  if ctypes.windll.kernel32.QueryDosDeviceA(sDeviceName, sNtDeviceName, MAX_PATH) == 0:
    return None;
  return sNtDeviceName.value;

if __name__ == "__main__":
  import sys;
  print repr(sys.argv);
  print queryDosDevice(sys.argv[1]);